package com.example.ibsp_demo.pojo.entity.message;

import java.time.LocalDateTime;

public class Message {
    private Integer msgId;       // 消息ID (对应数据库字段 msg_id)
    private Integer senderId;   // 发送者ID (对应数据库字段 sender_id)
    private Integer receiverId; // 接收者ID (对应数据库字段 receiver_id)
    private String msgType;     // 消息类型 (like/comment/follow/pm) (对应数据库字段 msg_type)
    private String content;     // 消息内容摘要 (对应数据库字段 content)
    private Integer relatedId;  // 关联内容ID (对应数据库字段 related_id)
    private LocalDateTime sendTime;      // 发送时间 (对应数据库字段 send_time)
    private Boolean isRead;     // 阅读状态 (对应数据库字段 is_read)

    public Message() {
    }

    public Message(Integer msgId, Integer senderId, Integer receiverId, String msgType, String content, Integer relatedId, LocalDateTime sendTime, Boolean isRead) {
        this.msgId = msgId;
        this.senderId = senderId;
        this.receiverId = receiverId;
        this.msgType = msgType;
        this.content = content;
        this.relatedId = relatedId;
        this.sendTime = sendTime;
        this.isRead = isRead;
    }

    public Integer getMsgId() {
        return msgId;
    }

    public void setMsgId(Integer msgId) {
        this.msgId = msgId;
    }

    public Integer getSenderId() {
        return senderId;
    }

    public void setSenderId(Integer senderId) {
        this.senderId = senderId;
    }

    public Integer getReceiverId() {
        return receiverId;
    }

    public void setReceiverId(Integer receiverId) {
        this.receiverId = receiverId;
    }

    public String getMsgType() {
        return msgType;
    }

    public void setMsgType(String msgType) {
        this.msgType = msgType;
    }

    public String getContent() {
        return content;
    }

    public void setContent(String content) {
        this.content = content;
    }

    public Integer getRelatedId() {
        return relatedId;
    }

    public void setRelatedId(Integer relatedId) {
        this.relatedId = relatedId;
    }

    public LocalDateTime getSendTime() {
        return sendTime;
    }

    public void setSendTime(LocalDateTime sendTime) {
        this.sendTime = sendTime;
    }

    public Boolean getRead() {
        return isRead;
    }

    public void setRead(Boolean read) {
        isRead = read;
    }

    @Override
    public String toString() {
        return "Message{" +
                "msgId=" + msgId +
                ", senderId=" + senderId +
                ", receiverId=" + receiverId +
                ", msgType='" + msgType + '\'' +
                ", content='" + content + '\'' +
                ", relatedId=" + relatedId +
                ", sendTime=" + sendTime +
                ", isRead=" + isRead +
                '}';
    }
}